//入口文件
//   "dev": "cross-env NODE_ENV=development webpack-dev-server --mode development --config webpack.config.js",
//"dev": "webpack-dev-server --open --hot --port 3000",
import Vue from 'vue'
//导入路由的包
import VueRouter from 'vue-router'
Vue.use(VueRouter)
//导入自己的router.js路由模块
import router from './router.js'

//按需导入Mint-UI组件
/*import { Header,Swipe,SwipeItem,Button,Toast,Lazyload } from 'mint-ui'
Vue.component(Header.name, Header)
Vue.component(Swipe.name, Swipe)
Vue.component(SwipeItem.name, SwipeItem)
Vue.component(Button.name, Button)
Vue.component(Toast.name, Toast)
Vue.use(Lazyload)*/
import MintUI from 'mint-ui'
Vue.use(MintUI)

import 'mint-ui/lib/style.min.css'

// 导入 MUI 的样式
import './lib/mui/css/mui.min.css'
import './lib/mui/css/icons-extra.css'

//导入app根组件
import app from './App.vue'

//导入vue-resource
import VueResource from 'vue-resource'
Vue.use(VueResource)

//导入axios
import axios from 'axios'
axios.defaults.baseURL='/api'         //关键代码,每次发送请求都会带一个/api的前缀
Vue.prototype.$axios=axios

Vue.config.productionTip=false

import Moment from 'moment'
//定义全局过滤器
Vue.filter('dataFormat',function (dataStr,pattern='YYYY-MM-DD') {
    Moment(dataStr).format(pattern)
})

//导入图片预览插件
import VuePreview from 'vue-preview'
Vue.use(VuePreview)

new Vue({
    el:'#app',
    render:c => c(app),
    router,
})
